package top.ztf.erp.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.ztf.erp.visitors.Visitor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Role {
    public interface Add{}
    public interface Update{}

    @NotNull(groups = Update.class)
    private String id;//主键id

    @NotNull(groups = {Add.class, Permission.Update.class})
    @Pattern(regexp = "^[0-9]{1,8}$",message = "不合法,只允许输入,0-9的数字,至少一位,最多8位",groups = {Add.class, Update.class})
    private String code;//角色码

    @NotNull(groups = {Add.class, Update.class})
    private String name;//角色名称
    private String remark;//角色备注
    private String creatTime;//创建时间
    private String editTime;//修改的时间

    /**
     * 访问者接口
     */
    public void visit(Visitor visitor){

    }

}
